<div class="container rj-bottom-margin">
    <div ng-if="vm.cart.data.items.length == 0">
        购物车是空的哦，快去选购吧！
    </div>
    <div ng-if="vm.cart.data.items.length != 0">
        <div class="row">
            <div class="col-sm-6 rj-form" ng-repeat="item in vm.cart.data.items">
                <div class="row rj-card ">
                    <div class="col-sm-6 hidden-xs">
                        <div ng-click="utility.showModalImage(item.product.images[0].url)" class="rj-link rj-image-card rj-image-card-contain rj-image-card-small" style="background-image: url({{item.product.images[0].url}});"></div>
                    </div>
                    <div class="col-sm-6 form-group">
                        <div>
                            {{item.product.name}}
                        </div>
                        <p></p>
                        <div>
                            {{item.product.price | currency:'￥'}}
                        </div>
                        <p>数量：</p>
                        <div class="input-group">
                            <span class="input-group-btn">
                                <button class="btn btn-default" type="button" ng-click="vm.reduceNumber(item);">
                                    -
                                </button>
                            </span>
                            <input class="form-control " type="text" ng-model="item.number"/>
                            <span class="input-group-btn">
                                <button class="btn btn-default" type="button" ng-click="vm.increaseNumber(item);">
                                    +
                                </button>
                            </span>
                        </div>

                        <div class="input-group" >
                            <textarea type="text" class="form-control" ng-model="item.message" placeholder="为本商品留言"></textarea>
                        </div>
                        <div>
                            <button class="btn btn-info" ng-click="vm.remove(item);">删除</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div style="margin-top: 3em;"></div>
        <h1 style="font-size: 2em;">地址选择<small> 配送地址以此为准</small></h1>
        <div class="row">
            <div class="col-sm-8">
                <div class="row" ng-show="vm.address.data.length==0">
                    您的地址薄是空的哦！快去<a class="btn btn-danger" ui-sref="address.edit">添加地址</a>吧！
                </div>
                <div class="row" ng-show="vm.address.data.length!=0">
                    <div class="col-sm-12 rj-card" ng-repeat="addr in vm.address.data">
                        <div class="row">
                            <div class="col-sm-10">{{addr.province.name}}{{addr.city.name}}{{addr.county.DisName}}{{addr.detail}}</div>
                            <div class="col-sm-2">{{addr.postcode}}</div>
                        </div>
                        <div class="row">
                            <div class="col-sm-2">{{addr.name}}</div>
                            <div class="col-sm-8">{{addr.phone}}</div>
                            <div class="col-sm-2 " >
                                <a class="btn btn-default {{vm.address_id == addr.id?'active':''}} "ng-click="vm.setAddressId(addr.id);">选定</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-4">
                <div class="row">
                    <div class="col-sm-12">
                        <h1><small>总金额：</small>{{vm.getTotalPrice()|currency:'￥'}}</h1>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-9">
                        <button class="btn btn-primary" ng-click="vm.makeOrder();">提交订单</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>